using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class uimanager : MonoBehaviour
{

    

    private static uimanager instance;
     public static uimanager Instance
    {
        get
        {
            if(instance==null)
            {
                instance = FindObjectOfType<uimanager>();
                if(instance==null)
                {
                    GameObject go = new GameObject("uimanager");
                    instance = go.AddComponent<uimanager>();
                }
            }
            return instance;
        }
           
            }
    public Image healthLine;
    public Text bulletCountText;
    public void UpdateHealthLine(int maxhealth ,int counthealth)
    {

        healthLine.fillAmount =(float) counthealth / (float)maxhealth;
    }
    public void UpdataBulletCount(int currentCount,int maxCount)
    {
        bulletCountText.text = currentCount.ToString() + "/" + maxCount.ToString();
    }
}
